$(document).ready(function(){
	globalWidth();
	
	$(window).resize(function() {
		globalWidth();
	});
});

function globalWidth(){
	var winWidth = $(window).width();
	var conWidth;
	if(winWidth < 440) {
		conWidth = 220;
	}else if(winWidth < 660) {
		conWidth = 440;
	} else if(winWidth < 880) {
		conWidth = 660;
	} else if(winWidth < 1100) {
		conWidth = 880;
	} else if(winWidth < 1320) {
		conWidth = 1100;
	} else {
		conWidth = 1320;
	}
	$('.wrap').width(conWidth);
}
function blocksit(currentWidth){
	var winWidth = $(window).width();
	var conWidth;
	if(winWidth < 440) {
		conWidth = 220;
		col = 1
	}else if(winWidth < 660) {
		conWidth = 440;
		col = 2
	} else if(winWidth < 880) {
		conWidth = 660;
		col = 3
	} else if(winWidth < 1100) {
		conWidth = 880;
		col = 4;
	} else if(winWidth < 1320) {
		conWidth = 1100;
		col = 5;
	} else {
		conWidth = 1320;
		col = 6;
	}
	currentWidth = conWidth;
	$('#blocksit-container').width(conWidth);
	$('#blocksit-container').BlocksIt({
		numOfCol: col,
		offsetX: 8,
		offsetY: 8
	});
	
}